'use strict'


import Http from '../kit/HttpKit'
import Api from './Api'

/**
* 用户信息模块
**/

const URL_DELETE = Api.API_URL + '/userInfo/delete'
const URL_ADD = Api.API_URL + '/userInfo/add'
const URL_MODIFY = Api.API_URL + '/userInfo/modify'



const getInfo = (callback)=>{
	var url = Api.API_URL + '/userInfo/getInfo';
	let data = {api_token: Api.getApiToken(), api_user_id: Api.getApiUserId()};
	Http.post(url, data, json=>{
		Api.getDataCB(json, callback);
	});
}

const list = (data, callback)=>{
	var url = Api.API_URL + '/userInfo/list';

	data.api_token = Api.getApiToken();
	data.api_user_id = Api.getApiUserId();

	Http.post(url, data, json=>{
		Api.getDataCB(json, callback);
	});
}

const getAccountInfoOf = (userId, callback)=>{
	var url = Api.API_URL + '/userInfo/getAccountInfoOf';

	let data = {userId, api_token: Api.getApiToken(), api_user_id: Api.getApiUserId()};

	Http.post(url, data, json=>{
		Api.getDataCB(json, callback);
	});
}


export default{
	getInfo, 
	list, getAccountInfoOf, 
	URL_DELETE, URL_ADD, URL_MODIFY
}
